PrintPRO 8 for ActiveX - User Guide > How To > Create Print Job > Add Text |
PrintPRO™ gives the developer flexibility when adding text. The simplest way to add text is to use the PrintText Method.
The PrintText method adds text at the CurrentX Property and CurrentY Property position. If the AddCR Property is set to True, PrintText Method automatically inserts a carriage return after the text is printed. The PrintText Method does not wrap text to a new line if it does not fit on the current line.
The TextHeight Method and the TextWidth Method can be used to return the height and width of a text string.
If you want to align the text, use the PrintTextAligned Method. This method automatically aligns text inside a rectangular area using the alignment style defined by the Alignment Property. Text will also automatically wordwrap if the WordWrap Property is set to True.
If you want to rotate the text, use the PrintTextRotated Method. This method lets you specify a rotation angle, pivot point and pivot mode. If the pivot point is not specified, the CurrentX Property and CurrentY Property values are used. The pivot mode specifies whether the text is left justified, right justified or center justified at the pivot point.
The Font object lets you set the printer's font name, size, and attributes (bold, underline, etc.). Use the Font Property to return a font object. If some containers, the font object is not readily available. In this case, use the following methods to change the font characteristics:
SetCtlFontSize — sets the font size.
SetCtlFontStyle — sets the font style.
SetCtlFontName — sets the font name.
The BackStyle Property lets you display text transparently or on a solid color background. The BackColor Property determines the color of the text background and the ForeColor Property determines the color of the text.